<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Event
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: Create.php 7659 2010-10-19 02:24:28Z john $
 * @author     John
 */

/**
 * @category   Application_Extensions
 * @package    Event
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Event_Form_Topic_Create extends Engine_Form {
	public function init() {
		$this->setTitle ( 'Post Discussion Topic' )->setAttrib ( 'id', 'event_topic_create' );
		
		$this->addElement ( 'Text', 'title', array ('label' => 'Title', 'allowEmpty' => false, 'required' => true, 'filters' => array (new Engine_Filter_Censor (), new Engine_Filter_HtmlSpecialChars () ), 'validators' => array (array ('StringLength', true, array (1, 64 ) ) ) ) );
		
		$this->addElement ( 'Textarea', 'body', array ('label' => 'Message', 'allowEmpty' => false, 'required' => true, 'filters' => array (new Engine_Filter_Censor (), new Engine_Filter_HtmlSpecialChars () )//new Engine_Filter_EnableLinks(),
		 ) );
		
		$this->addElement ( 'Checkbox', 'watch', array ('label' => 'Send me notifications when other members reply to this topic.', 'value' => true ) );
		
		$this->addElement ( 'Button', 'submit', array ('label' => 'Post New Topic', 'ignore' => true, 'type' => 'submit', 'decorators' => array ('ViewHelper' ) ) );
		
		$this->addElement ( 'Cancel', 'cancel', array ('label' => 'cancel', 'prependText' => ' or ', 'type' => 'link', 'link' => true, 'decorators' => array ('ViewHelper' ) ) );
		
		$this->addDisplayGroup ( array ('submit', 'cancel' ), 'buttons' );
	}
}